Imports System.Xml

<Serializable()> Friend Class BaseData
    Private m_data() As Byte = Nothing
    Private m_configID As Integer = -1
    Private m_vars As BVars = Nothing
    <NonSerialized()> Friend m_filename As String = ""

    Sub New()
        m_vars = New BVars("Bikirom Variables")
    End Sub

    Friend Sub setData(ByRef data As Byte())
        m_data = data
    End Sub
    Friend Sub setVars(ByRef variables As BVars)
        m_vars = variables
    End Sub
    Public Property configID() As Integer
        Get
            Return m_configID
        End Get
        Set(ByVal value As Integer)
            m_configID = value
        End Set
    End Property

    Friend Function getCar() As CarBase
        Dim f_return As New CarBase()
        f_return.ConfigID = m_configID
        f_return.setVars(m_vars)
        Dim f_config As New frmCarSelection(f_return)
        If f_config.getConfig() Then
            Dim f_data(f_return.DataEnd) As Byte
            For i As Integer = f_return.DataStart To f_return.DataEnd
                f_data(i) = m_data(i - f_return.DataStart)
            Next
            f_return.baseImport(f_data)
            f_return.setMap(f_data, 0)
            f_return.setMap(f_data, 1)
            f_return.setMap(f_data, 2)

            Return f_return
        Else
            Return Nothing
        End If
    End Function
End Class
'End Namespace